const aardio = require("aardio");
const { app, dialog } = require("electron");

// electron/aardio 初始化后执行
aardio.ready((win) => {
  if (!aardio.studioInvoke) {
    win.removeMenu();
  }

  win.on("close", (e) => {
    e.preventDefault();
    dialog
      .showMessageBox(win, {type: 'info', title: "提示：",message:'是否要退出系统？', buttons: ["取消", "确定"] })
      .then((e) => {
        if (e.response === 1) {
          win = null;
          app.exit();
        }
      });
  });
});

app.on("window-all-closed", () => {
  app.quit();
});
